package com.matrix.draft.jvm.methodarea;

import jdk.internal.org.objectweb.asm.ClassWriter;
import jdk.internal.org.objectweb.asm.Opcodes;

import java.util.stream.IntStream;

public class TestMethodArea extends ClassLoader {
    public static void main(String[] args) {

        TestMethodArea obj = new TestMethodArea();
        IntStream.range(0, 10000).forEach(i -> {
            ClassWriter cw = new ClassWriter(0);
            cw.visit(Opcodes.V1_8, Opcodes.ACC_PUBLIC, "Class" + i, null, "java/lang/object", null);
            byte[] bytes = cw.toByteArray();
            obj.defineClass("Class" + i, bytes, 0, bytes.length);
        });


    }
}
